import cern.jet.random.Exponential;
import cern.jet.random.engine.RandomEngine;

public class ExpGenerator implements TimeGenerator {

	private Exponential rndStream;
	private double lambda;

	public ExpGenerator(double expectation) {
		lambda = 1/expectation;
		long rngSeed = System.currentTimeMillis();
		RandomEngine generator = new cern.jet.random.engine.MersenneTwister((int) rngSeed);
		rndStream = new Exponential(lambda, generator);
	}
	
	
	public double generateDouble() {
		double val = rndStream.nextDouble();
		return val;
	}
}